/**══════════════════════════════════╗
*作    者：songbaobao                                                  ║
*职    业：我以我血荐轩辕                                              ║
*CSND地址：https://blog.csdn.net/weixin_43949535                       ║
**GitHub ：https://github.com/TsinghuaLucky912/My_own_C-_study_and_blog║
**GitEE  ：https://gitee.com/lucky912_admin/code-up_-pat               ║
*═══════════════════════════════════╣
*创建时间：                                                           
*功能描述：                                                            
*                                                                      
*                                                                      
*═══════════════════════════════════╣
*结束时间:                                                           
*═══════════════════════════════════╝
//                .-~~~~~~~~~-._       _.-~~~~~~~~~-.
//            __.'              ~.   .~              `.__
//          .'//              西南\./联大               \\`.
//        .'//                     |                     \\`.
//      .'// .-~"""""""~~~~-._     |     _,-~~~~"""""""~-. \\`.
//    .'//.-"                 `-.  |  .-'                 "-.\\`.
//  .'//______.============-..   \ | /   ..-============.______\\`.
//.'______________________________\|/______________________________`.
*/
#include <iostream>
#include <vector>
#include <string.h>
#include <unordered_map>
#include <ctype.h>
#include <queue>
#include <list>
#include <map>
#include <math.h>
#include <algorithm>
#include <iomanip>
using namespace std;


int main()
{
#if A
	int h, max, distance, H;
	char c = '*';

	while (EOF != scanf("%d", &h))
	{
		H = h;
		max = 3 * h - 2;
		distance = max - h;
		for (int i = 0; i < H; ++i)
		{
			for (int j = 0; j < distance; ++j)
				cout << " ";
			for (int j = 0; j < h; ++j)
				cout << c;
			cout << endl;
			h += 2;
			distance -= 2;
		}
	}
#endif

#if B
	int N, size, mid;
	char str[100] = { 0 };
	while (EOF != scanf("%s", str))
	{
		N = strlen(str);
		size = (N + 2) / 3;
		mid = N - 2 * size;

		int i = 0;
		for (; i < size-1; ++i)
		{
			printf("%c", str[i]);
			for (int j = 0; j < mid; ++j)
				printf(" ");
			printf("%c\n", str[N - i - 1]);
		}
		for (int j = i; j < N - i; ++j)
		{
			printf("%c", str[j]);
		}
		printf("\n");
	}
#endif

#if C
	int m, h, max, distance, H;
	char c = '*';

	scanf("%d", &m);
	while (m--)
	{
		scanf("%d", &h);
		H = h;
		max = 3 * h - 2;
		distance = (max - h) / 2;
		for (int i = 0; i < H; ++i)
		{
			for (int j = 0; j < distance; ++j)
				cout << " ";
			for (int j = 0; j < h; ++j)
				cout << c;
			for (int j = 0; j < distance; ++j)
				cout << " ";
			cout << endl;
			h += 2;
			distance -= 1;
		}
	}
#endif

#if D
	int n;
	while (EOF != scanf("%d", &n))
	{
		char myarray[50][99];

		for (int i = 0; i <= (2 * n - 1) / 2; ++i)
		{
			for (int j = 0; j < 2 * n - 1; ++j)
			{
				myarray[i][j] = ' ';
			}
		}

		for (int j = 0; j < 2 * n - 1; ++j)
		{
			if (j % 2 == 0)
				myarray[0][j] = '*';
		}

		for (int i = 1; i <= (2 * n + 1)/2; ++i)
		{
			int begin = i;
			for (int j = begin; j <= (2 * n - 2 - begin); ++j)
			{
				if (myarray[begin - 1][j] == '*')
					myarray[begin][j] = ' ';
				else
					myarray[begin][j] = '*';
			}
		}
		

		for (int i = 0; i <= (2 * n - 1)/2; ++i)
		{
			for (int j = 0; j < 2 * n - 1; ++j)
			{
				printf("%c", myarray[i][j]);
			}
			printf("\n");
		}

		for (int i = (2 * n + 1) / 2; i <= 2 * n - 2; ++i)
		{
			for (int j = 0; j < 2 * n - 1; ++j)
			{
				printf("%c", myarray[2 * n - 2 - i][j]);
			}
			printf("\n");
		}
	}
#endif

	return 0;
}
/**
*备用注释：
*
*
*
*/
